﻿namespace WinForms
{
    using Bll.Systems;
    using Model.Systems;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using WinForms.Properties;

    public class FrmAbout : Form
    {
        private Button btn_Close;
        private IContainer components = null;
        private GroupBox groupBox1;
        public const int HTCAPTION = 2;
        private Label label1;
        private Label label2;
        private Label label4;
        private Label lbl_ChainName;
        private Label lbl_Souquan;
        private Label lblTitle;
        private LinkLabel linkLabel1;
        private Panel pan_AllPanel;
        private Panel pan_AllPlanes;
        private Panel pan_Bottoms;
        private Panel pan_Dock;
        private Panel pan_DockBottom;
        private Panel pan_DockLeft;
        private Panel pan_DockRight;
        private Panel pan_Lefts;
        private Panel pan_Rights;
        private Panel pan_Top;
        private Panel pan_TopLeft;
        private Panel pan_TopRight;
        private Panel pan_ZhongJian;
        private Panel pane_TopT;
        private Panel panel_Button;
        private Panel panel9;
        private PictureBox pictureBox1;
        public const int SC_MOVE = 0xf010;
        public const int WM_SYSCOMMAND = 0x112;

        public FrmAbout()
        {
            this.InitializeComponent();
        }

        private void btn_Close_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmAbout_Load(object sender, EventArgs e)
        {
            DataTable list = ChainBll.GetList("");
            if (list.Rows.Count > 0)
            {
                ChainEnt model = ChainBll.GetModel(int.Parse(list.Rows[0]["ChainNum"].ToString()));
                this.lbl_ChainName.Text = model.ChainName + "  授权使用到期时间:" + model.OverTime.ToString("yyyy-MM-dd");
            }
        }

        private void InitializeComponent()
        {
            ComponentResourceManager resources = new ComponentResourceManager(typeof(FrmAbout));
            this.pan_DockLeft = new Panel();
            this.pan_Dock = new Panel();
            this.pan_AllPanel = new Panel();
            this.pan_AllPlanes = new Panel();
            this.label2 = new Label();
            this.linkLabel1 = new LinkLabel();
            this.groupBox1 = new GroupBox();
            this.lbl_ChainName = new Label();
            this.lbl_Souquan = new Label();
            this.pictureBox1 = new PictureBox();
            this.label4 = new Label();
            this.label1 = new Label();
            this.panel_Button = new Panel();
            this.btn_Close = new Button();
            this.panel9 = new Panel();
            this.pan_Rights = new Panel();
            this.pan_Lefts = new Panel();
            this.pan_Bottoms = new Panel();
            this.pane_TopT = new Panel();
            this.pan_DockBottom = new Panel();
            this.pan_DockRight = new Panel();
            this.pan_Top = new Panel();
            this.pan_ZhongJian = new Panel();
            this.lblTitle = new Label();
            this.pan_TopRight = new Panel();
            this.pan_TopLeft = new Panel();
            this.pan_Dock.SuspendLayout();
            this.pan_AllPanel.SuspendLayout();
            this.pan_AllPlanes.SuspendLayout();
            this.groupBox1.SuspendLayout();
            ((ISupportInitialize) this.pictureBox1).BeginInit();
            this.panel_Button.SuspendLayout();
            this.pan_Top.SuspendLayout();
            this.pan_ZhongJian.SuspendLayout();
            base.SuspendLayout();
            this.pan_DockLeft.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockLeft.Dock = DockStyle.Left;
            this.pan_DockLeft.Location = new Point(0, 0);
            this.pan_DockLeft.Name = "pan_DockLeft";
            this.pan_DockLeft.Size = new Size(1, 0x125);
            this.pan_DockLeft.TabIndex = 0;
            this.pan_Dock.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.pan_Dock.Controls.Add(this.pan_AllPanel);
            this.pan_Dock.Controls.Add(this.pan_DockBottom);
            this.pan_Dock.Controls.Add(this.pan_DockRight);
            this.pan_Dock.Controls.Add(this.pan_DockLeft);
            this.pan_Dock.Dock = DockStyle.Fill;
            this.pan_Dock.Location = new Point(0, 0x20);
            this.pan_Dock.Name = "pan_Dock";
            this.pan_Dock.Size = new Size(410, 0x125);
            this.pan_Dock.TabIndex = 5;
            this.pan_AllPanel.BackColor = Color.White;
            this.pan_AllPanel.Controls.Add(this.pan_AllPlanes);
            this.pan_AllPanel.Controls.Add(this.pan_Rights);
            this.pan_AllPanel.Controls.Add(this.pan_Lefts);
            this.pan_AllPanel.Controls.Add(this.pan_Bottoms);
            this.pan_AllPanel.Controls.Add(this.pane_TopT);
            this.pan_AllPanel.Dock = DockStyle.Fill;
            this.pan_AllPanel.Location = new Point(1, 0);
            this.pan_AllPanel.Name = "pan_AllPanel";
            this.pan_AllPanel.Size = new Size(0x198, 0x124);
            this.pan_AllPanel.TabIndex = 3;
            this.pan_AllPlanes.Controls.Add(this.label2);
            this.pan_AllPlanes.Controls.Add(this.linkLabel1);
            this.pan_AllPlanes.Controls.Add(this.groupBox1);
            this.pan_AllPlanes.Controls.Add(this.pictureBox1);
            this.pan_AllPlanes.Controls.Add(this.label4);
            this.pan_AllPlanes.Controls.Add(this.label1);
            this.pan_AllPlanes.Controls.Add(this.panel_Button);
            this.pan_AllPlanes.Controls.Add(this.panel9);
            this.pan_AllPlanes.Dock = DockStyle.Fill;
            this.pan_AllPlanes.Location = new Point(10, 10);
            this.pan_AllPlanes.Name = "pan_AllPlanes";
            this.pan_AllPlanes.Size = new Size(0x184, 0x110);
            this.pan_AllPlanes.TabIndex = 4;
            this.label2.AutoSize = true;
            this.label2.Location = new Point(0x9b, 0x73);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x2f, 12);
            this.label2.TabIndex = 0x19;
            this.label2.Text = "网  址:";
            this.linkLabel1.AutoSize = true;
            this.linkLabel1.Location = new Point(0xd0, 0x73);
            this.linkLabel1.Name = "linkLabel1";
            this.linkLabel1.Size = new Size(0x7d, 12);
            this.linkLabel1.TabIndex = 0x18;
            this.linkLabel1.TabStop = true;
            this.linkLabel1.Text = "http://www.teaxt.com";
            this.linkLabel1.LinkClicked += new LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
            this.groupBox1.Controls.Add(this.lbl_ChainName);
            this.groupBox1.Controls.Add(this.lbl_Souquan);
            this.groupBox1.Location = new Point(13, 0x91);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(0x16b, 0x45);
            this.groupBox1.TabIndex = 0x17;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "本产品使用权属于";
            this.lbl_ChainName.AutoSize = true;
            this.lbl_ChainName.Location = new Point(14, 0x1c);
            this.lbl_ChainName.Name = "lbl_ChainName";
            this.lbl_ChainName.Size = new Size(0, 12);
            this.lbl_ChainName.TabIndex = 1;
            this.lbl_Souquan.AutoSize = true;
            this.lbl_Souquan.Location = new Point(0x8f, 0x1c);
            this.lbl_Souquan.Name = "lbl_Souquan";
            this.lbl_Souquan.Size = new Size(0, 12);
            this.lbl_Souquan.TabIndex = 0;
            this.pictureBox1.ErrorImage = null;
            this.pictureBox1.Image = (Image) resources.GetObject("pictureBox1.Image");
            this.pictureBox1.Location = new Point(0x13, 0x13);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new Size(100, 0x71);
            this.pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
            this.pictureBox1.TabIndex = 0x16;
            this.pictureBox1.TabStop = false;
            this.label4.AutoSize = true;
            this.label4.Location = new Point(0x9a, 0x4a);
            this.label4.Name = "label4";
            this.label4.Size = new Size(0xcb, 12);
            this.label4.TabIndex = 0x15;
            this.label4.Text = "Copyright (C) TeaManage 2009-2010";
            this.label1.AutoSize = true;
            this.label1.Location = new Point(0x9a, 0x21);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0xbf, 12);
            this.label1.TabIndex = 0x13;
            this.label1.Text = "茶叶连锁店管理系统(标准版) 2010";
            this.panel_Button.Controls.Add(this.btn_Close);
            this.panel_Button.Dock = DockStyle.Bottom;
            this.panel_Button.Location = new Point(0, 0xe0);
            this.panel_Button.Name = "panel_Button";
            this.panel_Button.Size = new Size(0x184, 0x2b);
            this.panel_Button.TabIndex = 11;
            this.panel_Button.Paint += new PaintEventHandler(this.panel_Button_Paint);
            this.btn_Close.Location = new Point(0x9d, 10);
            this.btn_Close.Name = "btn_Close";
            this.btn_Close.Size = new Size(0x4b, 0x17);
            this.btn_Close.TabIndex = 6;
            this.btn_Close.Text = "关 闭";
            this.btn_Close.UseVisualStyleBackColor = true;
            this.btn_Close.Click += new EventHandler(this.btn_Close_Click);
            this.panel9.Dock = DockStyle.Bottom;
            this.panel9.Location = new Point(0, 0x10b);
            this.panel9.Name = "panel9";
            this.panel9.Size = new Size(0x184, 5);
            this.panel9.TabIndex = 3;
            this.pan_Rights.Dock = DockStyle.Right;
            this.pan_Rights.Location = new Point(0x18e, 10);
            this.pan_Rights.Name = "pan_Rights";
            this.pan_Rights.Size = new Size(10, 0x110);
            this.pan_Rights.TabIndex = 3;
            this.pan_Lefts.Dock = DockStyle.Left;
            this.pan_Lefts.Location = new Point(0, 10);
            this.pan_Lefts.Name = "pan_Lefts";
            this.pan_Lefts.Size = new Size(10, 0x110);
            this.pan_Lefts.TabIndex = 2;
            this.pan_Bottoms.Dock = DockStyle.Bottom;
            this.pan_Bottoms.Location = new Point(0, 0x11a);
            this.pan_Bottoms.Name = "pan_Bottoms";
            this.pan_Bottoms.Size = new Size(0x198, 10);
            this.pan_Bottoms.TabIndex = 1;
            this.pane_TopT.Dock = DockStyle.Top;
            this.pane_TopT.Location = new Point(0, 0);
            this.pane_TopT.Name = "pane_TopT";
            this.pane_TopT.Size = new Size(0x198, 10);
            this.pane_TopT.TabIndex = 0;
            this.pan_DockBottom.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockBottom.Dock = DockStyle.Bottom;
            this.pan_DockBottom.Location = new Point(1, 0x124);
            this.pan_DockBottom.Name = "pan_DockBottom";
            this.pan_DockBottom.Size = new Size(0x198, 1);
            this.pan_DockBottom.TabIndex = 2;
            this.pan_DockRight.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockRight.Dock = DockStyle.Right;
            this.pan_DockRight.Location = new Point(0x199, 0);
            this.pan_DockRight.Name = "pan_DockRight";
            this.pan_DockRight.Size = new Size(1, 0x125);
            this.pan_DockRight.TabIndex = 1;
            this.pan_Top.Controls.Add(this.pan_ZhongJian);
            this.pan_Top.Controls.Add(this.pan_TopRight);
            this.pan_Top.Controls.Add(this.pan_TopLeft);
            this.pan_Top.Dock = DockStyle.Top;
            this.pan_Top.Location = new Point(0, 0);
            this.pan_Top.Name = "pan_Top";
            this.pan_Top.Size = new Size(410, 0x20);
            this.pan_Top.TabIndex = 4;
            this.pan_ZhongJian.BackgroundImage = Resources.uc_title_2;
            this.pan_ZhongJian.Controls.Add(this.lblTitle);
            this.pan_ZhongJian.Dock = DockStyle.Fill;
            this.pan_ZhongJian.Location = new Point(0x1f, 0);
            this.pan_ZhongJian.Name = "pan_ZhongJian";
            this.pan_ZhongJian.Size = new Size(0x176, 0x20);
            this.pan_ZhongJian.TabIndex = 2;
            this.pan_ZhongJian.MouseDown += new MouseEventHandler(this.pan_ZhongJian_MouseDown);
            this.lblTitle.AutoSize = true;
            this.lblTitle.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.lblTitle.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.lblTitle.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.lblTitle.Location = new Point(6, 8);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new Size(0x23, 13);
            this.lblTitle.TabIndex = 0;
            this.lblTitle.Text = "关于";
            this.pan_TopRight.BackgroundImage = Resources.uc_title_1;
            this.pan_TopRight.Dock = DockStyle.Right;
            this.pan_TopRight.Location = new Point(0x195, 0);
            this.pan_TopRight.Name = "pan_TopRight";
            this.pan_TopRight.Size = new Size(5, 0x20);
            this.pan_TopRight.TabIndex = 1;
            this.pan_TopLeft.BackgroundImage = Resources.uc_title;
            this.pan_TopLeft.Dock = DockStyle.Left;
            this.pan_TopLeft.Location = new Point(0, 0);
            this.pan_TopLeft.Name = "pan_TopLeft";
            this.pan_TopLeft.Size = new Size(0x1f, 0x20);
            this.pan_TopLeft.TabIndex = 0;
            this.pan_TopLeft.MouseDown += new MouseEventHandler(this.pan_TopLeft_MouseDown);
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(410, 0x145);
            base.Controls.Add(this.pan_Dock);
            base.Controls.Add(this.pan_Top);
            this.DoubleBuffered = true;
            base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FrmAbout";
            base.ShowInTaskbar = false;
            base.Load += new EventHandler(this.FrmAbout_Load);
            this.pan_Dock.ResumeLayout(false);
            this.pan_AllPanel.ResumeLayout(false);
            this.pan_AllPlanes.ResumeLayout(false);
            this.pan_AllPlanes.PerformLayout();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            ((ISupportInitialize) this.pictureBox1).EndInit();
            this.panel_Button.ResumeLayout(false);
            this.pan_Top.ResumeLayout(false);
            this.pan_ZhongJian.ResumeLayout(false);
            this.pan_ZhongJian.PerformLayout();
            base.ResumeLayout(false);
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                Process.Start("IEXPLORE.EXE", "http://www.teaxt.com");
            }
            catch (Exception)
            {
            }
        }

        private void pan_TopLeft_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void pan_ZhongJian_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void panel_Button_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_Button, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 1);
        }

        private void Panel_ResetPaint(PaintEventArgs e, Panel panel, Color color, int leftBoder, int topBoder, int rightBoder, int bottomBoder)
        {
            ControlPaint.DrawBorder(e.Graphics, panel.ClientRectangle, color, leftBoder, ButtonBorderStyle.Solid, color, topBoder, ButtonBorderStyle.Solid, color, rightBoder, ButtonBorderStyle.Solid, color, bottomBoder, ButtonBorderStyle.Solid);
        }

        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
    }
}

